package com.example.supermarket.controller;

import com.vainycos.core.feign.customer.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Vainycos
 * @description
 * @date: 2023/1/16 13:30
 */
@RequestMapping("/market")
@RestController
public class MarketController {

    @Autowired
    private CustomerService customerService;

    @GetMapping("/buy")
    public String order(String things, Integer id){
        String customerById = customerService.getCustomerById(id);
        return customerById + "购买了" +things;
    }

    /**
     * 获取商品列表
     * @return
     */
    @GetMapping("/listMarket")
    public String listMarket(){
        return "啤酒，瓜子，花生米";
    }
}
